package com.bwie.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 秒杀商品表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_goods")
public class Goods implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 商品ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商品名称
     */
    @TableField(value = "goods_name")
    private String goodsName;

    /**
     * 商品原价
     */
    @TableField(value = "goods_price")
    private BigDecimal goodsPrice;

    /**
     * 秒杀价
     */
    @TableField(value = "seckill_price")
    private BigDecimal seckillPrice;

    /**
     * 初始库存
     */
    @TableField(value = "initial_stock")
    private Integer initialStock;

    /**
     * 当前可用库存
     */
    @TableField(value = "available_stock")
    private Integer availableStock;

    /**
     * 乐观锁版本号，用于防止超卖
     */
    @TableField(value = "version")
    private Integer version;
}